#include "Grid.h"

Grid::Grid(int n, double xmin, double xmax, double ymin, double ymax)
    : n(n), xmin(xmin), xmax(xmax), ymin(ymin), ymax(ymax) {
    h = (xmax - xmin) / (n + 1);
}

int Grid::getN() const {
    return n;
}

double Grid::getX(int i) const {
    return xmin + i * h;
}

double Grid::getY(int j) const {
    return ymin + j * h;
}

double Grid::geth() const {
    return h;
}

bool Grid::isInside(double x, double y) const {
    return (x >= xmin && x <= xmax && y >= ymin && y <= ymax);
}